#include "LinkListQueue.h"
#include<iostream>
using namespace std;
Queuehead* creatQueue()
{

	Queuehead* node = (Queuehead*)malloc(sizeof(Queuehead));
	if (!node)
	{
		return NULL;
	}
	node->count = 0;
	node->front = node->rear = NULL;
}

void releaseQueue(Queuehead* head)
{
	while (head->front != head->rear)
	{
		QueueNode* tmp = head->front;
		head->front = tmp->next;
		free(tmp);
	}
	head->front = head->rear = NULL;
}

void isFull(Queuehead* head)
{
	if (head->front == head->rear&&front&&rear)
	{
		cout << "Queue is full!" << endl;
	}
}

void isEmpty(Queuehead* head)
{
	if (head->front == NULL && head->rear == NULL)
	{
		cout << "Queue is empty" << endl;
	}
}

void push(Queuehead* head, Element_t val)
{
	QueueNode* new_node = (QueueNode*)malloc(sizeof(QueueNode));
	if (new_node == NULL)
	{
		return;
	}
	new_node->val = val;
	new_node->next = nullptr;
	head->rear->next = new_node;
	head->rear = new_node;
}

void pop(Queuehead* head)
{
	if (!head)
	{
		return;
	}
	QueueNode* tmp = head->front;
	head->front = tmp->next;
	free(tmp);
}





